<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePostTopicsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('post_topics',function(Blueprint $table){
             $table->engine = 'InnoDB';
             $table->bigIncrements('id');
             $table->bigInteger('post_id')->default(0)->comment('文章表外键');
             $table->bigInteger('topic_id')->default(0)->comment('专题表外键');
             $table->integer('created_at')->default(0)->comment('创建时间');
             $table->integer('updated_at')->default(0)->comment('修改时间');
             $table->index('post_id');
             $table->index('topic_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('post_topics');
    }
}
